<?php

namespace app\admin\controller;

use app\admin\controller\CommonController;
use think\Validate;
use think\Db;
use app\admin\model\ServiceNews;

class NewsController extends CommonController {
    /*
     * 消息管理
     * author xfwed 
     * date 2019.09.30
     */

    public function newsList() {
        $titleid = input('param.titleid');//1店铺动态2预约消息3营收消息
        $perPage = input('param.perPage');
        $page = input('param.page');

        if ($titleid) {
            $where['titleid'] = $titleid;
        }

        $where = isset($where)?$where:[];
        $perPage = isset($perPage) ? $perPage : 10;
        $page = isset($page) ? $page : 1;
        $list = ServiceNews::where($where)->field('id,titleid,content,add_time')->paginate($perPage);
        return $this->ajaxReturn(0, '查询成功', $list);
    }

    
}
